home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
DO1002.ARJ
/
EXIST.SCR
< prev
next >
Wrap
Text File
|
1991-12-13
|
974b
|
31 lines
.pg wi full clr cy
COMMAND NAME»gray«: »%t« IfExists »ye«
/EXIST {Filename}
/cw
If the file »cy«{Filename}»#« exists, »%t«DO»#« branches to "»ye«:EXISTOK»#«". If
»cy«{Filename}»#« does not exist, »%t«DO»#« branches to "»ye«:EXISTERROR»#«". Any
variables in »cy«{Filename}»#« are expanded. »wh«Full filenames,
including sub-directories can be checked.
»gr«
NOTE»gray«: »#«The »cy«{Filename}»#« must be valid. An invalid filename will
result in a branch to "»ye«:EXISTERROR»#«".
.pg clr
You can enter a file name (we're using the »%t«/GETS»#« command)
and see if the file exists. The sequence continues until you hit
»bo«<Enter>»#« in response to the prompt:
/SET DefaultString ""
/REPEAT
/GETS MyFile DefaultString " Filename: " "" UC
/IF %Myfile NE "" EEND
|/EXIST %MyFile
:EXISTOK
%Myfile Exists
/GOTO EEND
:EXISTERROR
%MyFile does NOT exist
:EEND
/UNTIL %MyFile EQ ""
/ENDEXEC CLEAR